package cn.geminis.warehouse.service.inventory.entity;

import cn.geminis.lowcode.annotation.*;
import cn.geminis.warehouse.service.basic.entity.ProductBatch;
import jakarta.persistence.Column;
import jakarta.persistence.ManyToOne;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 装箱关系
 */
@Getter
@Setter
@UuidEntity
@QueryFilter
@CrudRepository
@CrudController
public class ProductBatchInContainer {

    @ManyToOne(optional = false)
    @QueryFilterProperty(fieldName = "container.id", propertyName = "containerId", propertyType = "String")
    private Container container;

    @ManyToOne(optional = false)
    @QueryFilterProperty(fieldName = "productBatch.id", propertyName = "productBatchId", propertyType = "String")
    private ProductBatch productBatch;

    @Column(nullable = false)
    private int amount;

    @Column(nullable = false)
    private LocalDateTime time;

}
